// 刚刚封装的axios
import request from "./axios";

// 权限
export const getMenu = query => {
	return request({
		url: "Learn/Admin/AdminRoles",
		method: "post",
		data: query
	});
};
// 1.消息通知
export const getHomeMess = query => {
	return request({
		url: "Learn/Notice/GetAdminMsgLog",
		method: "post",
		data: query
	});
};

// 2.首页公告栏
export const getNews = query => {
	return request({
		url: "Learn/Notice/GetNotice",
		method: "post",
		data: query
	});
};

// 3.公告详情
export const getNewsDetail = query => {
	return request({
		url: "Learn/Notice/NoticeRow",
		method: "post",
		data: query
	});
};

// 4.数据列表
export const getTypeList = query => {
	return request({
		url: "Learn/Task/GetTask",
		method: "post",
		data: query
	});
};

// 5.登录
export const postLogin = query => {
	return request({
		url: "Learn/Admin/Login",
		method: "post",
		data: query
	});
};

// 6.获取用户信息
export const getUserInfo = query => {
	return request({
		url: "Learn/Admin/GetAdminRow",
		method: "post",
		data: query
	});
};

// 7.任务详情
export const getTaskDetail = query => {
	return request({
		url: "Learn/Task/TaskRow",
		method: "post",
		data: query
	});
};

// 8.领取任务
export const receiveTask = query => {
	return request({
		url: "Learn/Task/RecTask",
		method: "post",
		data: query
	});
};

// 9.进行中
export const typeTask = query => {
	return request({
		url: "Learn/Task/GetRecTask",
		method: "post",
		data: query
	});
};

// 10.放弃任务
export const giveupTask = query => {
	return request({
		url: "Learn/Task/UpRecTask",
		method: "post",
		data: query
	})
}

// 部门列表
export const departList = (query) => {
	return request({
		url: 'Learn/Department/Lists',
		method: 'post',
		data: query
	})
}
// 添加部门
export const addDepart = (query) => {
	return request({
		url: 'Learn/Department/Add',
		method: 'post',
		data: query
	})
}

// 编辑部门
export const editDepart = (query) => {
	return request({
		url: 'Learn/Department/Edit',
		method: 'post',
		data: query
	})
}
// 编辑部门
export const deleteDepart = (query) => {
	return request({
		url: 'Learn/Department/Delete',
		method: 'post',
		data: query
	})
}

// 11.删除文件
export const getdelFile = (query) => {
	return request({
		url: 'Learn/Admin/Remove_file',
		method: 'post',
		data: query
	})
}

// 12.获取部门
export const getDepartment = (query) => {
	return request({
		url: 'Learn/Department/TreeList',
		method: 'post',
		data: query
	})
}
// 添加管理员
export const addAdmin = (query) => {
	return request({
		url: 'Learn/admin/addAdmin',
		method: 'post',
		data: query
	})
}

// 修改管理员
export const editAdmin = (query) => {
	return request({
		url: 'Learn/admin/editAdmin',
		method: 'post',
		data: query
	})
}


// 13 获取部门分类 部门人员
export const getDeparlist = () => {
	return request({
		url: "Learn/Department/treeList",
		method: "post",
		params: { pageSize: 100 }
	});
};


// 14 提交任务
export const postaddTask = (query) => {
	return request({
		url: "?s=Learn.Task.PushTask",
		method: "post",
		data: query
	});
};

// 14 提交公告
export const postaddNotice = (query) => {
	return request({
		url: "Learn/Notice/PushNotice",
		method: "post",
		data: query
	});
};
//15.注册账号
export const RegisterUsers = (query) => {
	return request({
		url: "Learn/Admin/RegisterUsers",
		method: "post",
		data: query
	})
}

//16.发送手机验证码
export const sendPhoneCode = (query) => {
	return request({
		url: "Learn/Admin/SendPhoneCode",
		method: "post",
		data: query
	})
}




// 结束任务
export const endTask = (query) => {
	return request({
		url: "Learn/Task/DelTask",
		method: "post",
		data: query
	});
};


// 14 提交公告
export const getAdminList = (query) => {
	return request({
		url: "Learn.Admin.AdminList",
		method: "post",
		data: query
	});
};


// 获取编辑数据
export const taskDetail = (query) => {
	return request({
		url: "Learn/Task/TaskRow",
		method: "post",
		data: query
	});
};

// 14 删除管理员
export const deleteAdminListRow = (id) => {
	return request({
		url: "Learn.Admin.AdminStatus",
		method: "post",
		data: {
			admin_id: id
		}
	});
};



// 14 编辑任务
export const editTask = (query) => {
	return request({
		url: "Learn/Task/EditTask",
		method: "post",
		data: query
	});
};

// 获取分组列表
export const getGroups = (data) => {
	return request({
		url: "Learn.Admin.GetGroups",
		method: "post",
		data
	});
};

// 启用禁用管理员接口
export const changeStatusAdmin = (oldStatus, admin_id) => {
	let status = oldStatus ? 1 : 0;
	return request({
		url: "Learn.Admin.AdminStatus",
		method: "post",
		data: {
			status,
			admin_id,
		}
	});
};


//提交任务
export const addTask = (data) => {
	return request({
		url: "Learn.Admin.GetGroups",
		method: "post",
		data
	});
};

//知识库
export const getKnowledge = (data) => {
	return request({
		url: "Learn/KnowledgeBase/GetKnowledgeBase",
		method: "post",
		data
	});
};

//删除知识库
export const delKnowledge = (data) => {
	return request({
		url: "Learn/KnowledgeBase/DelKnowledgeBase",
		method: "post",
		data
	});
};

//发布知识库
export const postKnowledge = (data) => {
	return request({
		url: "Learn/KnowledgeBase/AddKnowledgeBase",
		method: "post",
		data
	});
};

// 角色列表
export const roleList = (data) => {
	return request({
		url: "Learn.Admin.GetGroups",
		method: "post",
		data
	});
};
// 添加角色
export const addRoleApi = (data) => {
	return request({
		url: "Learn.Admin.Addgroup",
		method: "post",
		data
	});
};
// 编辑角色
export const editRoleApi = (data) => {
	return request({
		url: "Learn.Admin.editgroup",
		method: "post",
		data
	});
};
// 删除角色
export const delRoleApi = (data) => {
	return request({
		url: "Learn.Admin.group_del",
		method: "post",
		data
	});
};
// 角色详情
export const RoleDetailApi = (data) => {
	return request({
		url: "Learn.Admin.group_row",
		method: "post",
		data
	});
};
// 权限菜单
export const jurisdictionMenu = (data) => {
	return request({
		url: "Learn.Admin.AdminRoles",
		method: "post",
		data
	});
};
//编辑知识库详情
export const releasDetail = (data) => {
	return request({
		url: "Learn/KnowledgeBase/FindKnowledgeBase",
		method: "post",
		data
	});
};


//提交知识库
export const addReleas = (data) => {
	return request({
		url: "Learn/KnowledgeBase/EditKnowledgeBase",
		method: "post",
		data
	});
};

//统计注册用户
export const CountUsers = (data) => {
	return request({
		url: "Learn/Admin/CountRegisterUsers",
		method: "post",
		data
	})
}

//首页任务统计
export const GetTotalTask = (data) => {
	return request({
		url: "Learn/Task/GetTotalTask",
		method: "post",
		data
	})
}

//提醒审核
export const RemindCheck = (data) => {
	return request({
		url: "Learn/Task/RemindCheck",
		method: "post",
		data
	})
}

// 获取审核列表
export const getExaRecTask = (data) => {
	return request({
		url: "Learn.Task.GetExaRecTask",
		method: "post",
		data
	});
};
//删除公告
export const dekNotice = (data) => {
	return request({
		url: "Learn/Notice/DelNotice",
		method: "post",
		data
	});
};

//任务大厅
export const getTaskHall = (data) => {
	return request({
		url: "Learn/Task/GetTaskHall",
		method: "post",
		data
	});
};


//知识广场
export const getKnowledgeBaseHall = (data) => {
	return request({
		url: "Learn/KnowledgeBase/GetKnowledgeBaseHall",
		method: "post",
		data
	});
};


//余额、积分列表
export const getMoneyIntegralLog = (data) => {
	return request({
		url: "Learn/Task/GetMoneyIntegralLog",
		method: "post",
		data
	})
}
//审核通过
export const addExaRecTask = (data) => {
	return request({
		url: "Learn/Task/ExaRecTask",
		method: "post",
		data
	});
};

//添加栏目
export const addMenus = (data) => {
	return request({
		url: "Portal/Page/AddNewMenu",
		method: "post",
		data
	});
};

